package com.frxuexi.demo.news

import com.bumptech.glide.Glide
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.frxuexi.base.entity.RecordEntity
import com.frxuexi.demo.R

class NewsAdapter:BaseQuickAdapter<RecordEntity,BaseViewHolder>(R.layout.item_news) {
    override fun convert(helper: BaseViewHolder, item: RecordEntity) {
        helper.setText(R.id.txt_name,item.title)
        helper.setText(R.id.txt_content,item.content)
        helper.setText(R.id.tv_look_number,"阅读量：${item.looks}")
        helper.setText(R.id.tv_time,item.createTime)
        Glide.with(context).load(item.imgurl).circleCrop().into(helper.getView(R.id.img_url))
    }
}